<?php
/**
 * 异常 管理
 *
 * @author    Alex Xun xunzhibin@expert.com
 * @version   1.0
 * @copyright (C) 2018 Jnexpert Ltd. All rights reserved
 * @file      Http.php
 */

namespace app\common\exception;

use Exception;
use think\exception\Handle;
use think\exception\HttpException;

/**
 * 自定义异常类
 *
 * @author Alex Xun xunzhibin@jnexpert.com
 * @package common
 */
class Http extends Handle
{
    public function render(Exception $e)
    {
        // exit($e->getMessage());
        return json([
            'status'  => FALSE,
            'errCode' => $e->getCode(),
            'errMsg'  => $e->getMessage()
        ], 400);

         //TODO::开发者对异常的操作
        //可以在此交由系统处理
        return parent::render($e);
    }
}
